<template>
  <div>
    NewsItem
    <p>{{ title }}</p>
  </div>
</template>

<script lang="ts">
import {defineComponent} from "vue";

export default defineComponent({
  name: "NewsItem",
});

</script>

<script lang="ts" setup>
import {useRoute} from "vue-router";
import {computed} from "vue";

// 获取路由的参数
const route = useRoute()

const title = computed(() => {
  return route.query.title
})
</script>

<style lang="scss" scoped>

</style>